package com.itheima.charstream;

import java.io.FileReader;
import java.io.IOException;

/*
读 一次读取一组字
 */
public class Demo05 {

    public static void main(String[] args) throws IOException {
        FileReader reader = new FileReader("day13\\b.txt");
        char[] chars = new char[1024];//1024个字//提前准备好的容器


    /*    int len = reader.read(chars);//len  读取到字的个数
        System.out.println("读取到了" + len + "个字");
        System.out.println(chars);//打印字符数组 直接打印内容   */
    int  len;
    while ((len=reader.read(chars))!=-1){

        //chars  0,len
        String s = new String(chars, 0, len);
        System.out.println(s);

    }
        reader.close();

    }
}
